<template>
	<view>
		<view class="smart-container">1.容器</view>
		<view class="smart-panel-h" @click="goDetailPage('view')"><text>view视图</text></view>
		<view class="smart-panel-h" @click="goDetailPage('scroll-view')"><text>scroll-view滚动视图</text></view>
		<view class="smart-panel-h" @click="goDetailPage('swipter')"><text>swiper可滑动视图</text></view>
		<view class="smart-container">2.基础内容</view>
		<view class="smart-panel-h" @click="goDetailPage('text')"><text>text文本编辑</text></view>
		<view class="smart-panel-h" @click="goDetailPage('rich-tex')"><text>rich-text富文本编辑</text></view>
		<view class="smart-panel-h" @click="goDetailPage('progress')"><text>progress进度条</text></view>
		<view class="smart-container">3.表单组件</view>
		<view class="smart-panel-h" @click="goDetailPage('button')"><text>button按钮</text></view>
		<view class="smart-panel-h" @click="goDetailPage('radio')"><text>radio单选框</text></view>
		<view class="smart-panel-h" @click="goDetailPage('checkbox')"><text>checkbox多选框</text></view>
		<view class="smart-panel-h" @click="goDetailPage('input')"><text>input输入控件</text></view>
		<view class="smart-panel-h" @click="goDetailPage('picker')"><text>picker选择列表</text></view>
		<view class="smart-panel-h" @click="goDetailPage('slider')"><text>slider滑块</text></view>
		<view class="smart-panel-h" @click="goDetailPage('switch')"><text>switch开关</text></view>
		<view class="smart-panel-h" @click="goDetailPage('textarea')"><text>textarea多行文本输入框</text></view>
		<view class="smart-panel-h" @click="goDetailPage('form')"><text>form表单</text></view>
		<view class="smart-container">4.导航组件</view>
		<view class="smart-panel-h" @click="goDetailPage('navigator')"><text>navigator导航</text></view>
		<view class="smart-container">5.新闻组件</view>
		<view class="smart-panel-h" @click="goDetailPage('cardViewPage')"><text>cardViewPage新闻</text></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
	 methods: {
	    goDetailPage(e) {
	      if (typeof e === 'string') {
	        let url;
	        // 区分不同目录的页面路径
	        if (e === 'cardViewPage') {
	          // cardViewPage 位于 pages 目录下
	          url = `/pages/${e}/${e}`;
	        } else {
	          // 其他页面位于 pages/components 目录下
	          url = `/pages/components/${e}/${e}`;
	        }
	        // 执行跳转
	        uni.navigateTo({ url });
	      } else {
	        // 处理对象形式的参数（如原有逻辑中的e.url）
	        uni.navigateTo({ url: e.url });
	      }
	    }
	  }
	};
</script>

<style>

</style>